package com.lizhaoshan.controller;

import com.lizhaoshan.common.R;
import com.lizhaoshan.common.Result;
import com.lizhaoshan.common.TokenHolder;
import com.lizhaoshan.dto.CategoryDto;
import com.lizhaoshan.service.CategoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Objects;

/**
 * @program: reggie
 * @description: 分类控制层
 * @author: lamour
 * @create: 2022-05-14 19:27
 **/
@Slf4j
@RestController
// @RequestMapping("category")
public class CategoryController {

    @Autowired
    private CategoryService categoryService;

    // @PostMapping
    // public Result getCategory(CategoryDto categoryDto){
    //     log.info("**********分类添加，begin");
    //
    //     if (Objects.isNull(categoryDto)){
    //         return Result.error("暂无数据");
    //     }
    //
    //     boolean category = categoryService.getCategory(categoryDto);
    //
    //     log.info("**********分类添加,end");
    //     return category?Result.success("添加成功"):Result.error("添加失败");
    // }

}
